---
id: 5900f4ca1000cf542c50ffdc
title: '問題349：蘭頓的螞蟻'
challengeType: 1
forumTopicId: 302008
dashedName: problem-349-langtons-ant
---

# --description--

An ant moves on a regular grid of squares that are coloured either black or white.

從一個完全是白色的網格開始，在螞蟻1018次移動後，有多少個方塊是黑色的？

- if it is on a black square, it flips the color of the square to white, rotates 90° counterclockwise and moves forward one square.
- if it is on a white square, it flips the color of the square to black, rotates 90° clockwise and moves forward one square.

Starting with a grid that is entirely white, how many squares are black after ${10}^{18}$ moves of the ant?

# --hints--

`langtonsAnt()` should return `115384615384614940`.

```js
assert.strictEqual(langtonsAnt(), 115384615384614940);
```

# --seed--

## --seed-contents--

```js
function langtonsAnt() {

  return true;
}

langtonsAnt();
```

# --solutions--

```js
// solution required
```
